/*
 * AIData.h
 *
 *  Created on: Sep 1, 2017
 *      Author: gaoyi
 */

#pragma once

#include "Character/newAI/AIDefine.h"
#include "Common/DeclareProperty.h"
#include "Character/Creature.h"

class AIData
{
public:
	AIData(Creature *pMaster);
	virtual ~AIData();
public:
	//
	DECLARE_PROPERTY_OBJECT_PTR(Creature, Master);				//Master

	DECLARE_PROPERTY_INT32(CurState);								//��ǰAI״̬
	DECLARE_PROPERTY_INT32(PreState);								//��һ��AI״̬
	DECLARE_PROPERTY_UINT64(BornTime);							//����ʱ��

	DECLARE_PROPERTY_OBJECT(Point3<float>, BornPos);			//����λ��
	DECLARE_PROPERTY_UINT64(BornProtectTime);					//��������ʱ��, ���ų�����Ч
public:
	//�������л�õĶ���
	DECLARE_PROPERTY_INT32(AttackType);							//�������� �����򱻶�
	DECLARE_PROPERTY_BOOL(CanAttack);							//�ܷ񹥻�
	DECLARE_PROPERTY_BOOL(CanMove);								//�ܷ��ƶ�
	DECLARE_PROPERTY_FLOAT(ActiveRange);						//���Χ
	DECLARE_PROPERTY_FLOAT(PursuitRange);						//׷����Χ
	//Ѳ��
public:
	DECLARE_PROPERTY_INT32(PatrolType);							//Ѳ������
	DECLARE_PROPERTY_INT32(PatrolStep);							//Ѳ�߲���
	DECLARE_PROPERTY_OBJECT(Point3<float>, CurPatrolPos)		//Ѳ�ߵ�ǰPos
	DECLARE_PROPERTY_OBJECT(std::vector<Point3<float>>, PatrolPath);		//Ѳ��·��
	DECLARE_PROPERTY_BOOL(PatrolBack);							//// �Ƿ�����Ѳ��(true����)
public:
	//��Ϣ
	DECLARE_PROPERTY_INT32(RestTimeData);							//��Ϣʱ��
	DECLARE_PROPERTY_UINT64(PatrolRestTime);					//Ѳ����Ϣʱ��
public:
	//�ƶ�
	DECLARE_PROPERTY_INT32(MoveType);								//�ƶ�����
	DECLARE_PROPERTY_FLOAT(MoveSpeed);							//�ƶ��ٶ�
	DECLARE_PROPERTY_FLOAT(RunSpeed);							//�ܲ��ٶ�
public:
	DECLARE_PROPERTY_UINT64(FollowTargetCid);					//����״̬��������
public:
	DECLARE_PROPERTY_OBJECT(Point3<float>, DestPos);			//Ŀ��λ��
public:
	//
	virtual bool Init();										//��ʼ�� ������Ҫ��д
	virtual bool UnInit();										//������Ҫ��д
public:
	bool IsMoving();											//�Ƿ������ƶ�
	bool IsCanRandomMove();										//�ǲ��ǿ���������ƶ�
	bool IsCanPatrolMove();										//�ǲ��ǿ�����Ѳ���ƶ�
public:
	Point3<float> GetPatrolPath(int index);						//���·���ϵ�һ����
public:
	bool AIMove(const Point3<float>& pos, int walkType);		//�ƶ���һ����
	void StopMove(bool isBroadClient);							//AIֹͣ�ƶ�
	bool PlayActionOnPatrolPoint(int step);						//�������ж���
};


